package a.j;

import a.c.d;
import a.d.n;
import a.d.o;
import a.d.w;
import a.f.gc;
import a.f.mc;
import a.f.wb;

import java.awt.*;
import java.awt.geom.Line2D;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

class lg
  implements vf.d_
{
  private re a;
  private y b;
  private o c;
  private re.a_ d;
  private re.a_ e;
  private w f;
  private double g;
  private double h;
  
  lg(re paramre)
  {
    this.a = paramre;
  }
  
  public void a(vf.a_ parama_)
  {
    boolean bool = ld.E;
    this.g = parama_.d();
    this.h = parama_.e();
    ig localig = (ig)parama_.b();
    this.c = localig.d();
    this.f = this.c.l();
    Object localObject = localig.e();
    if (!bool) {}
    re.a_ locala_ = (re.a_)((localObject instanceof re.a_) ? localObject : this.a.a());
    this.d = locala_;
    this.e = locala_;
    vf localvf = parama_.a();
    if (!bool)
    {
      if (localvf.x())
      {
        this.b = localvf.w();
        this.b.a(localvf.i);
      }
    }
    else {
      this.b.a(new w(this.g, this.h), (ig)parama_.b());
    }
  }
  
  public void b(vf.a_ parama_)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    d_ locald_ = new d_(this, parama_);
    if (!bool2)
    {
      if (parama_.f())
      {
        ig localig = (ig)parama_.b();
        if (!bool2) {}
        e_ locale_ = a(localig.lb()) ? a(locald_) : b(locald_);
        a.c.z localz = new a.c.z();
        if (!bool2)
        {
          if (locale_ == null)
          {
            if (bool2) {
              break label122;
            }
            locald_.e();
            if (!bool1) {}
          }
          else
          {
            localz.add(locale_);
          }
        }
        else {
          locald_.f = locale_.c();
        }
        label122:
        w localw = locald_.a(localz);
        o localo = locald_.d();
        double d1 = locald_.c();
        if (!bool2) {}
        double d2 = d1 < 1.0D ? 0.1D : 0.1D / d1;
        if (bool2) {
          return;
        }
        if (w.a(localo.l(), localw) > d2)
        {
          tb localtb = locald_.a.nb();
          locald_.e.b(localw);
          locald_.f = ((re.a_)locald_.b.b(locald_.e, localtb, localtb.h(), localtb.g()));
          if (bool2) {
            return;
          }
          if (!bool1) {}
        }
      }
      else
      {
        this.b.i();
      }
    }
    else {
      locald_.e();
    }
    this.e = locald_.f;
    locald_.a.a(locald_.f);
  }
  
  private boolean a(d paramd)
  {
    boolean bool = ld.E;
    g localg = (g)paramd.c();
    tb localtb = localg.t(paramd);
    if ((bool) || (paramd.g())) {
      if (bool) {}
    }
    return localtb.n() == 1;
  }
  
  public void c(vf.a_ parama_)
  {
    c();
  }
  
  public void a()
  {
    c();
  }
  
  private void c()
  {
    this.a = null;
    this.b = null;
    this.c = null;
    this.d = null;
    this.e = null;
  }
  
  private e_ a(d_ paramd_)
  {
    double d1 = paramd_.a();
    re localre = paramd_.b;
    o localo = paramd_.e;
    ig localig = paramd_.a;
    tb localtb = localig.nb();
    re.a_ locala_ = localre.a(localo, localtb, this.d, (byte)0);
    w localw = localtb.p().e();
    if (w.a(localo.l(), localw) < d1)
    {
      c_ localc_ = new c_();
      localc_.a(localw);
      localc_.a(paramd_.d);
      return new e_(locala_, localw, localc_);
    }
    return null;
  }
  
  private e_ b(d_ paramd_)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    double d1 = paramd_.a();
    re localre = paramd_.b;
    re.a_ locala_1 = paramd_.c;
    o localo = paramd_.e;
    ig localig = paramd_.a;
    tb localtb = localig.nb();
    ld localld1 = localtb.h();
    ld localld2 = localtb.g();
    re.a_ locala_2 = localre.a(localo, localtb, locala_1, (byte)0);
    w localw1 = localre.a(localo.f(), localtb, localld1, localld2, locala_2).l();
    n localn = locala_2.g();
    c_ localc_ = null;
    Object localObject1;
    Object localObject2;
    if ((bool2) || (localn != null))
    {
      localObject1 = localn.d();
      localObject2 = localn.e();
      localc_ = new c_(((w)localObject1).a(), ((w)localObject1).b(), ((w)localObject2).a(), ((w)localObject2).b());
      localc_.a(paramd_.d);
    }
    if (w.a(localo.l(), localw1) < d1)
    {
      localObject1 = new mc();
      ((mc)localObject1).a(locala_2);
      ((mc)localObject1).a(localre);
      ((mc)localObject1).a(localo);
      ((mc)localObject1).a(localig.b());
      localObject2 = localre.a((wb)localObject1, localtb, localld1, localld2);
      Object localObject3 = null;
      double d2 = d1 * 0.5D;
      if (((bool2) || (localObject2 != null)) && ((bool2) || (!((a.c.z)localObject2).isEmpty())))
      {
        int i = localtb.a() + 1;
        a.c.y localy = ((a.c.z)localObject2).h();
        do
        {
          if (!localy.e()) {
            break;
          }
          gc localgc = (gc)localy.j();
          w localw2 = localgc.j().l();
          if (bool1) {
            break label435;
          }
          if (localc_ != null)
          {
            if (bool2) {
              continue;
            }
            if (a(locala_2, localgc.c(), i))
            {
              localc_.a(localw2);
              double d3 = w.a(localw2, localw1);
              if (bool2) {
                continue;
              }
              if (d3 < d2)
              {
                localObject3 = localgc;
                d2 = d3;
              }
            }
          }
          localy.f();
        } while (!bool1);
      }
      if ((!bool2) && (localObject3 != null)) {
        return new e_((re.a_)localObject3.c(), localObject3.j().l(), localc_);
      }
      label435:
      return new e_(locala_2, localw1, localc_);
    }
    return null;
  }
  
  private static boolean a(Object paramObject1, Object paramObject2, int paramInt)
  {
    boolean bool = ld.E;
    re.a_ locala_1 = (re.a_)paramObject1;
    int i = locala_1.a();
    if (!bool) {}
    int j = i < 0 ? i + paramInt : i;
    re.a_ locala_2 = (re.a_)paramObject2;
    int k = locala_2.a();
    if (!bool) {}
    int m = k < 0 ? k + paramInt : k;
    if (!bool)
    {
      if (j != m) {
        break label104;
      }
      if (bool) {
        break label101;
      }
    }
    label101:
    label104:
    return locala_1.e() == locala_2.e();
  }
  
  private static class e_
    extends ve
  {
    private final re.a_ k;
    private final w l;
    
    e_(re.a_ parama_, w paramw, lg.c_ paramc_)
    {
      super(paramc_);
      this.k = parama_;
      this.l = paramw;
    }
    
    public byte a(w paramw, Point2D.Double paramDouble, byte paramByte)
    {
      paramDouble.x = this.l.a();
      paramDouble.y = this.l.b();
      return 3;
    }
    
    public boolean a(w paramw1, w paramw2, byte paramByte)
    {
      boolean bool = ld.E;
      if ((bool) || (paramw2.a == this.l.a())) {
        if (bool) {}
      }
      return paramw2.b == this.l.b();
    }
    
    re.a_ c()
    {
      return this.k;
    }
  }
  
  private static class c_
    implements qb
  {
    private static final double a = 10.0D;
    private static final double b = 6.0D;
    private final double c;
    private final double d;
    private final double e;
    private final double f;
    private y g;
    private boolean h;
    private final List i;
    
    c_(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
    {
      this.c = paramDouble1;
      this.d = paramDouble2;
      this.e = paramDouble3;
      this.f = paramDouble4;
      this.i = new ArrayList(3);
      this.h = true;
    }
    
    c_()
    {
      this.c = 0.0D;
      this.d = 0.0D;
      this.e = 0.0D;
      this.f = 0.0D;
      this.i = new ArrayList(1);
      this.h = false;
    }
    
    public void paint(Graphics2D paramGraphics2D)
    {
      Color localColor = paramGraphics2D.getColor();
      Stroke localStroke = paramGraphics2D.getStroke();
      paramGraphics2D.setColor(a());
      paramGraphics2D.setStroke(new BasicStroke());
      a(new lg.0(this, paramGraphics2D));
      paramGraphics2D.setColor(localColor);
      paramGraphics2D.setStroke(localStroke);
    }
    
    public Rectangle getBounds()
    {
      boolean bool = ld.E;
      Rectangle2D.Double localDouble = new Rectangle2D.Double(0.0D, 0.0D, -1.0D, -1.0D);
      a(new lg.1(this, localDouble));
      if (!bool) {
        if (localDouble.getWidth() >= 0.0D)
        {
          if (bool) {
            break label96;
          }
          if (localDouble.getHeight() >= 0.0D) {
            localDouble.setFrame(localDouble.getX() - 2.0D, localDouble.getY() - 2.0D, localDouble.getWidth() + 4.0D, localDouble.getHeight() + 4.0D);
          }
        }
      }
      label96:
      return localDouble.getBounds();
    }
    
    void a(w paramw)
    {
      this.i.add(paramw);
    }
    
    void a(y paramy)
    {
      this.g = paramy;
    }
    
    Color a()
    {
      if (!ld.E) {
        if (this.g == null) {
          return Color.LIGHT_GRAY;
        }
      }
      return this.g.a();
    }
    
    void a(a_ parama_)
    {
      boolean bool2 = ld.E;
      boolean bool1 = ld.D;
      Line2D.Double localDouble = new Line2D.Double();
      a.d.z localz;
      if (this.h)
      {
        localz = new a.d.z(this.e - this.c, this.f - this.d);
        localz.c();
        d1 = 10.0D * localz.a();
        d2 = 10.0D * localz.b();
        localDouble.setLine(this.c - d1, this.d - d2, this.e + d1, this.f + d2);
        parama_.a(localDouble);
        if (bool2) {
          break label162;
        }
        if (!bool1) {}
      }
      else
      {
        localz = new a.d.z(0.0D, -1.0D);
      }
      double d1 = localz.a();
      double d2 = localz.b();
      if ((bool2) || (!this.i.isEmpty()))
      {
        label162:
        Iterator localIterator = this.i.iterator();
        do
        {
          if (!localIterator.hasNext()) {
            break;
          }
          w localw = (w)localIterator.next();
          double d3 = localw.a() - 3.0D * (d1 - d2);
          double d4 = localw.b() - 3.0D * (d1 + d2);
          double d5 = d3 + d1 * 6.0D;
          double d6 = d4 + d2 * 6.0D;
          double d7 = d3 + d1 * 6.0D - d2 * 6.0D;
          double d8 = d4 + d2 * 6.0D + d1 * 6.0D;
          double d9 = d3 - d2 * 6.0D;
          double d10 = d4 + d1 * 6.0D;
          localDouble.setLine(d3, d4, d7, d8);
          parama_.a(localDouble);
          localDouble.setLine(d5, d6, d9, d10);
          parama_.a(localDouble);
        } while (!bool1);
      }
    }
    
    static abstract interface a_
    {
      public abstract void a(Line2D paramLine2D);
    }
  }
  
  private static final class d_
  {
    final ig a;
    final re b;
    final re.a_ c;
    final y d;
    o e;
    re.a_ f;
    
    d_(lg paramlg, vf.a_ parama_)
    {
      double d1 = parama_.d() - paramlg.g;
      double d2 = parama_.e() - paramlg.h;
      w localw = paramlg.f;
      this.a = ((ig)parama_.b());
      this.b = paramlg.a;
      this.f = paramlg.e;
      this.c = paramlg.d;
      this.d = paramlg.b;
      this.e = new o(paramlg.c);
      if (!ld.E) {
        if (this.b.c()) {
          this.e.a(6.283185307179586D - this.c.f());
        }
      }
      this.e.g(localw.a() + d1, localw.b() + d2);
    }
    
    double a()
    {
      return this.d.f() / c();
    }
    
    double c()
    {
      return this.d.d().M();
    }
    
    w a(a.c.z paramz)
    {
      return this.d.b(paramz, this.e.l());
    }
    
    o d()
    {
      tb localtb = this.a.nb();
      return this.b.a(this.e.f(), localtb, localtb.h(), localtb.g(), this.f);
    }
    
    void e()
    {
      this.f = this.b.a(this.e, this.a.nb(), this.f, (byte)2);
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.lg

 * JD-Core Version:    0.7.0.1

 */